<template>
  <div class="homeWrapper">
    <MapVue ref="mapInstance" />
    <scrollList @updateUI="updateUI" />
  </div>
</template>

<script>
// @ is an alias to /src
//导入全局配置
import { EVENT_TYPES } from "../global";
import MapVue from "@/components/map/Map.vue";
import scrollList from "@/components/list/scrollList";
export default {
  provide() {
    return {
      mapInstace: () => {
        return "this.$refs.mapInstance";
      },
    };
  },
  name: "home",
  components: {
    MapVue,
    scrollList,
  },
  methods: {
    updateUI(_type, _params) {
      console.log(_type);
      console.log(_params);
      if (_type == EVENT_TYPES.UPDATE_MAP_VECTORLAYER) {
        //更新矢量地图
        this.$refs.mapInstance.getAreatData(_params["code"]);
      }
    },
  },
};
</script>
<style scoped>
.homeWrapper {
  width: 100%;
  height: 100%;
}
</style>
